package cn.js.sangu.unitStore.entity;

import cn.hutool.core.annotation.Alias;
import cn.js.sangu.unitStore.dto.FileListDTO;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.JsonNode;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * 立项记录表(Project)表实体类
 *
 * @author 林硕
 * @since 2025-01-15 08:20:12
 */
// 移除 @SuppressWarnings("serial") 注解，因为它可能导致某些 'serial' 问题未被分析
// @SuppressWarnings("serial")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("project")
public class Project {

    @TableId(type = IdType.AUTO)
    private Integer id;

    @Alias("创建时间")
    @TableField(fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private Date creatTime;

    @Alias("更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private Date updateTime;

    //
    @Alias("备注")
    private String remark;
    //
    @Alias("项目编号")
    private String projectNum;
    //
    @Alias("项目名称")
    private String projectName;
    //
    @Alias("项目标签")
    private String projectTag;
    //
    @Alias("项目简述")
    private String projectDescription;

    @Alias("附件名称")
    private String attachName;

    @Alias("附件id(多个以,分开)")
    private String attachIds;

    @Alias("创建人id")
    private Integer creator;

    @Alias("创建人名称")
    @TableField(exist = false)
    private String creatorName;

    @Alias("修改人id")
    private Integer modifier;

    @Alias("修改人名称")
    @TableField(exist = false)
    private String modifierName;

    @Alias("审核人id")
    private Integer auditor;

    @Alias("审核人名称")
    @TableField(exist = false)
    private String auditorName;

    @Alias("接收人id")
    private Integer recipient;

    @Alias("接收人名称")
    @TableField(exist = false)
    private String recipientName;

    @Alias("状态")
    private Integer state;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    @Alias("立项审核时间")
    private Date projectApprovalTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    @Alias("起草时间")
    private Date draftingTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    @Alias("图纸审核时间")
    private Date drawingAuditTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    @Alias("修改图纸时间")
    private Date drawingRevisionTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    @Alias("正式发图时间")
    private Date formalDrawingTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    @Alias("负责人接收时间")
    private Date receiptTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "Asia/Shanghai")
    @Alias("过期时间")
    private Date expirationTime;

    @Alias("文件列表")
    @TableField(exist = false)
    private List<FileListDTO> fileList;

    @Alias("文件列表JSON")
    @TableField("file_list_json")
    private JsonNode fileListJson;
}


